import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
      path:'/',
      redirect: '/loginPage'
    },
    {
      path: '/loginPage',
      name: 'loginPage',
      component: ()=>import('../pages/loginPage/LoginPage.vue')
    },
    {
      path:'/layoutPage',
      name:'LayoutPage',
      redirect:'/layoutPage/console',
      component: ()=>import('../pages/layoutPage/layout/LayoutPage.vue'),
      children:[
        {
          path:"console",
          name:"Console",
          meta:{
            isAuth:false,
            name:"控制台"
          },
          component: ()=>import('../pages/childPage/ConsolePage.vue')
        },
        {
          path:"doctorManagementPage",
          name:"DoctorManagementPage",
          meta:{
            isAuth:false,
            name:"医生管理"
          },
          component: ()=>import('../pages/childPage/DoctorManagementPage.vue')
        },
        {
          path:"appointmentManagementPage",
          name:"AppointmentManagementPage",
          meta:{
            isAuth:false,
            name:"预约管理"
          },
          component: ()=>import('../pages/childPage/AppointmentManagementPage.vue')
        },
        {
          path:"medicalRecordsPage",
          name:"MedicalRecordsPage",
          meta:{
            isAuth:false,
            name:"诊疗记录"
          },
          component: ()=>import('../pages/childPage/MedicalRecordsPage.vue')
        },
        {
          path:"userManagermentPage",
          name:"UserManagermentPage",
          meta:{
            isAuth:false,
            name:"用户管理"
          },
          component: ()=>import('../pages/childPage/UserManagermentPage.vue')
        },{
          path:"serviceRecordsPage",
          name:"ServiceRecordsPage",
          meta:{
            isAuth:false,
            name:"服务记录"
          },
          component: ()=>import('../pages/childPage/ServiceRecordsPage.vue')
        },{
          path:"serviceDetailsPage",
          name:"ServiceDetailsPage",
          meta:{
            isAuth:false,
            name:"服务管理"
          },
          component: ()=>import('../pages/childPage/ServiceDetailsPage.vue')
        },
        {
          path:"medicationManagementPage",
          name:"MedicationManagementPage",
          meta:{
            isAuth:false,
            name:"药品管理"
          },
          component: ()=>import('../pages/childPage/MedicationManagementPage.vue')
        },
        {
          path:"docotorCreatePage",
          name:"DocotorCreatePage",
          meta:{
            isAuth:false,
            name:"医生入职"
          },
          component: ()=>import('../pages/childPage/DocotorCreatePage.vue')
        },
        {
          path:"serviceDetailsCreatePage",
          name:"ServiceDetailsCreatePage",
          meta:{
            isAuth:false,
            name:"添加服务"
          },
          component: ()=>import('../pages/childPage/ServiceDetailsCreatePage.vue')
        },
        {
          path:"userInfoPage",
          name:"UserInfoPage",
          meta:{
            isAuth:false,
            name:"用户信息"
          },
          component: ()=>import('../pages/childPage/UserInfoPage.vue')
        },
        {
          path:"changePasswordPage",
          name:"ChangePasswordPage",
          meta:{
            isAuth:false,
            name:"修改密码"
          },
          component: ()=>import('../pages/childPage/ChangePasswordPage.vue')
        },
      ]
    }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
